package cn.tedu.submarine;
/*
import java.util.Scanner;

public class tsy {
    public static void main(String[] args) {
        System.out.println("输入");
        Scanner scan = new Scanner(System.in);
        String str = scan.nextLine();
        char[] ch = str.toCharArray();
        int num=0,letter=0;
        for (int i =0;i<ch.length;i++){
            if (ch[i]>='0' && ch[i]<=9){
                num++;

            }else if(ch[i]>='a' && ch[i]<='z'  || ch[i]>='A'  &&ch[i]<='Z'){
                letter++;
            }
        }
        System.out.println("是"+num+" "+letter);

    }
}


 */
import java.util.Arrays;
import java.util.Scanner;
public class tsy {
    public static void main(String[] args) {
        //SSS 0 SS1-5 S6-15 A16-35 B36-65 C66-100


        Scanner scan = new Scanner(System.in);
        System.out.println("抽一次还是抽十次：");
        int guess = scan.nextInt();

        switch (guess) {
            case 1:
                Lucky l1=new Lucky();
                break;
            case 10:
                int i;
                int[] arr = new int[10];
                for (i = 0; i < arr.length; i++) {
                    arr[i] = (int) (Math.random() * 101);
                }
                arr = Arrays.copyOf(arr, arr.length - 1);
                Lucky l2=new Lucky(arr);
                int min = arr[0];
                for (i = 1; i < arr.length; i++) {
                    if (arr[i] < min) {
                        min = arr[i];
                    }
                }
                if (min < 16) {
                    Lucky l3=new Lucky();
                } else {
                    int c = (int) (Math.random() * 10 + 6);
                    System.out.println("额外获得S" + c);
                }
                break;
        }
    }
}

class Lucky {
    Lucky(){
        int a = (int) (Math.random() * 101);
        if (a == 0) {
            System.out.print("SSS" + a + " ");
        } else if (a<= 5) {
            System.out.print("SS" + a + " ");
        } else if (a <= 15) {
            System.out.print("S" + a + " ");
        } else if (a <= 35) {
            System.out.print("A" + a + " ");
        } else if (a <= 65) {
            System.out.print("B" + a + " ");
        } else if (a <= 100) {
            System.out.print("C" + a + " ");
        }
    }
    Lucky(int arr[]){
        for(int i = 0;i<arr.length;i++)
        {
            if (arr[i] == 0) {
                System.out.print("SSS" + arr[i] + " ");
            } else if (arr[i] <= 5) {
                System.out.print("SS" + arr[i] + " ");
            } else if (arr[i] <= 15) {
                System.out.print("S" + arr[i] + " ");
            } else if (arr[i] <= 35) {
                System.out.print("A" + arr[i] + " ");
            } else if (arr[i] <= 65) {
                System.out.print("B" + arr[i] + " ");
            } else if (arr[i] <= 100) {
                System.out.print("C" + arr[i] + " ");
            }
        }
    }
}
